﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Mozhi.Abp.Core.Extensions
{
    public static class IntExtension
    {
        public static string ToJournalNumber(this int value, int length = 6)
        {
            if (value == 0)
                throw new ArgumentNullException("value");

            var currentLength = value.ToString().Length;

            if (currentLength >= length)
                return value.ToString();

            return "00000000000".Substring(0, length - currentLength) + value.ToString();
        }
    }
}
